473,418 Members | 2,093 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,418 software developers and data experts.

Menu rollover doesn't work with IE6

Hello all,

I am trying to develop a roll-over menu effect on a page. It works fine with all other browsers except IE6. Can some one please help me?

HTML:
Expand|Select|Wrap|Line Numbers
  1. <div class="menu-item-wrap">
  2.                     <a href="#" class="menu-item-text">
  3.                         Menu1                    
  4.                     </a>
  5.                     <div class="menu-item-divider"></div>
  6.                     <div class="clear"></div>
  7.                     <div class="submenu-wrap">                    
  8.                             <table class="menu-item-table" cellpadding="0" cellspacing="0">
  9.                                 <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 1 of Menu 1</a></td></tr>
  10.                                 <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 2</a></td></tr>
  11.                                 <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 3</a></td></tr>
  12.                                 <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 4</a></td></tr>
  13.                             </table>
  14.                     </div>                    
  15.                 </div>
  16.  
  17.  
  18.                 <div class="menu-item-wrap">
  19.                     <a href="#" class="menu-item-text">
  20.                         This is Menu2
  21.                     </a>
  22.                     <div class="menu-item-divider"></div>
  23.                     <div class="clear"></div>
  24.                     <div class="submenu-wrap">                    
  25.                         <table class="menu-item-table" cellpadding="0" cellspacing="0">
  26.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 1 of 2</a></td></tr>
  27.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">MenuItem2</a></td></tr>
  28.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">MenuItem3</a></td></tr>
  29.                         </table>
  30.                     </div>                    
  31.                 </div>
  32.  
  33.  
  34.                 <div class="menu-item-wrap">
  35.                     <a href="#" class="menu-item-text">
  36.                         Menu3
  37.                     </a>
  38.                     <div class="menu-item-divider"></div>
  39.                     <div class="clear"></div>
  40.                     <div class="submenu-wrap">                    
  41.                         <table class="menu-item-table" cellpadding="0" cellspacing="0">
  42.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">Sub Menu Item 1/3</a></td></tr>
  43.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">MenuItem2</a></td></tr>
  44.                             <tr><td class="submenu-td"><a href="javascript:void();" class="submenu-link">MenuItem3</a></td></tr>                            
  45.                         </table>
  46.                     </div>                    
  47.                 </div>
  48.  
CSS:
Expand|Select|Wrap|Line Numbers
  1. .menu-item-wrap
  2. {
  3.     float:left;    
  4.     padding-left:5px;    
  5. }
  6. A.menu-item-text
  7. {
  8.     text-decoration:none;
  9.     color:#000000;
  10.     float:left;
  11.     padding-left:5px;
  12.     padding-right:10px;
  13. }
  14. .menu-item-divider
  15. {
  16.     width:1px;
  17.     height:30px;
  18.     background-image: url(../Images/menubar.png);
  19.     background-repeat:no-repeat;
  20.     float:left;
  21.     margin-top:-2px;    
  22. }
  23. TABLE.menu-item-table
  24. {
  25.     position:absolute;
  26.     overflow:visible;
  27.     margin-top:-3px;
  28.     margin-left:-6px;    
  29.     border-top:solid 1px #CBD1E0;        
  30. }
  31. TABLE.menu-item-table TD.submenu-td
  32. {
  33.     background-color:#EEE9A8;
  34.     border-bottom:solid 1px #CBD1E0;
  35.     border-left:solid 1px #CBD1E0;
  36.     border-right:solid 1px #CBD1E0;
  37. }
  38. A.submenu-link
  39. {
  40.     text-decoration:none;
  41.     color:#354260;
  42.     padding:2px 10px;    
  43.     display:block;
  44.     width:100%;
  45. }
  46. A:hover.submenu-link 
  47. {    
  48.     color:#354260;
  49.     display:block;
  50. }
  51. TABLE.menu-item-table TD.menu-selected-cell
  52. {
  53.     background-color:#CBD1E0;    
  54. }
  55. .submenu-wrap
  56. {
  57.     display:none;        
  58. }
  59. .submenu-wrap-show
  60. {
  61.     display:block;        
  62.     -width:300px;            
  63. }
  64.  
  65. javascript:
  66. var $j = jQuery.noConflict();
  67. $j(document).ready(function(){
  68.  
  69.     $j("TD.submenu-td").hover(        
  70.         function(){
  71.             $j(this).addClass("menu-selected-cell");                
  72.         },
  73.         function(){
  74.             $j(this).removeClass("menu-selected-cell");
  75.         }
  76.     );
  77.  
  78.     $j(".menu-item-wrap").hover(
  79.         function(){$j("div.submenu-wrap",this).fadeIn(100); },
  80.         function(){$j("div.submenu-wrap",this).fadeOut(100);}
  81.     );
  82.     if(document.all){
  83.         $j(".menu-item-wrap").hoverClass("submenu-wrap-show");
  84.     }    
  85. });
  86. $j.fn.hoverClass = function(c){
  87.     return this.each(function(){
  88.         $j(this).hover(
  89.             function() { $j(this).addClass(c); },
  90.             function() {$j(this).removeClass(c);}
  91.         );            
  92.     });
  93. };
  94.  
Thanks in advance,
DK.
Sep 18 '09 #1
2 4145
Oh I just solved it:

CSS:
Expand|Select|Wrap|Line Numbers
  1. TABLE.menu-item-table
  2. {
  3.     position:absolute;
  4.     overflow:visible;
  5.     margin-top:-3px;
  6.     margin-left:-6px;    
  7.     border-top:solid 1px #CBD1E0;        
  8.     -width:200px;
  9. }
  10. .submenu-wrap
  11. {
  12.     display:none;        
  13.     -position:absolute;
  14. }
  15. .submenu-wrap-show
  16. {
  17.     display:block;        
  18.     width:auto;
  19. }
  20.  
Sep 18 '09 #2
numberwhun
3,509 Expert Mod 2GB
You really need to please use code tags around any code you place into the forums. Its a requirement.

Regards,

Jeff
Sep 18 '09 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: JesusFreak | last post by:
From: us_traveller@yahoo.com (JesusFreak) Newsgroups: microsoft.public.scripting.jscript Subject: toolbar script problem NNTP-Posting-Host: 192.92.126.136 Recently, I downloaded the following...
1
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i...
13
by: Mr. Clean | last post by:
Can a rolloever menu be done using only CSS, without javascript?
12
by: Kyle James Matthews | last post by:
Hello, I have been lurking here for a little bit (truth be told, I lurk on too many newsgroups to be truly effective). I have made a CSS rollover menu, and would like some advice. The menu is...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
7
by: tfsmag | last post by:
Has anyone had a problem with putting a menu control into a master page in .net 2.0? I have a problem where if i just drop a menu control on a regular page the menu works fine, the submenus work...
1
by: proplady | last post by:
I've had this menu for some time, and periodically make changes. I've made some changes now (just some menu items), and the menu will not show up on my webpages. I know it's something simple,...
0
by: Czechfish | last post by:
My files are located here: HTML & SWF FLA I am trying to create a multi-tier drop down menu, but I can't get it to work. Maintime line, frame 1 - loads a mc. When you rollover the mc, this...
1
by: mikeguy3086 | last post by:
Here is what I'm trying to achieve: I'm making a site that is basically a big slide show which is insignificant, but it has to be really minimalistic. So what I did was make an invisible button...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.